<?php

declare(strict_types=1);

namespace App\Model\PssModel;

use App\Model\BaseModel\BasePssModel;
use App\Service\Code\Normal;

class Banner extends BasePssModel
{
    public $table = 'banner';
    
    //指定写入字段
    protected $fillable = [
        
    ];
    
    //指定字段展示类型
    protected $casts = [
        'id' => 'string'
    ];
    
    /**
     * 获取首页轮播管理
     * @param number $type
     */
    public function getBannerHomeList( $type = 1 )
    {
        $list = self::query()
        ->where([
            'type'  => 1,
            'df'    => 0,
        ])
        ->select([
            'id',
            'image',
            'link'
        ])
        ->get()
        ->toArray();
        
        return Normal::returnCode(Normal::SUC,"获取成功",$list);
    }
}